
#include <reg51.h>
#include <intrins.h>
typedef unsigned char uint8;

typedef unsigned int uint16;


code uint8 LED_CODE[] = {

    // 1, 3, 2, 0, 0, 2, '-', 9
    0xF9, 0xB0, 0xA4, 0xC0, 0xC0, 0xA4, 0x40, 0x90 // '-'
};



void delay(uint16 x)

{

uint16 i,j;

for(i = x; i > 0; i --)

for(j = 114; j > 0; j --);

}



void main()

{

	char i,k=0x80;
	while(1)
	{
	 	for(i=8;i>0;i--)
		{
		 	P2=0xff;
			k=_crol_(k,1);
			P0=LED_CODE[8-i];
			P2=k;
			delay(1000);
		}
	}
	
	
	/**
uint8 i;

while(1)

{

for(i = 0; i < 8; i ++)

{

P0 = 0xff;

P3 = 0x01 << i;

P0 = LED_CODE[i];

delay(5000);

}

}
**/
}



